/* ═══════════════════════════════════════════════
   RANKING GOBERNADORES — rank_estilo.css
   Cripeso · Sistema de Inteligencia Electoral
═══════════════════════════════════════════════ */

:root {
    --azul:    #2c5e97;
    --verde:   #91be33;
    --gris:    #e9e9e9;
    --blanco:  #ffffff;
    --texto:   #1e2a3a;
    --sombra:  0 4px 18px rgba(0,0,0,.10);
}

/* Prevenir desbordamiento horizontal global */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}
*, *::before, *::after {
    box-sizing: border-box;
}

body { background: var(--gris); font-family: 'Segoe UI', sans-serif; }

/* ── TÍTULO SECCIÓN ── */
.titulo-seccion {
    font-size: 1.5rem; font-weight: 900;
    color: var(--azul); text-transform: uppercase;
    letter-spacing: 1px; display: inline-block;
    padding-bottom: 6px;
    border-bottom: 3px solid var(--verde);
    margin-bottom: 20px;
}

/* ── TABS ── */
.tabs-ranking {
    display: flex; gap: 0;
    background: #fff;
    border-radius: 50px;
    padding: 4px;
    box-shadow: var(--sombra);
    width: fit-content;
    margin: 0 auto 18px;
    flex-shrink: 0;
}
.tab-btn {
    border: none; background: transparent;
    padding: 9px 32px; border-radius: 50px;
    font-weight: 700; font-size: .9rem;
    color: var(--azul); cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.tab-btn.activo {
    background: var(--verde);
    color: #fff;
    box-shadow: 0 2px 10px rgba(145,190,51,.4);
}

/* ── BADGE ÚLTIMO DATO IZQUIERDO ── */
#badge-ultimo-dato-izq {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1.5px solid #e4edf7;
    border-radius: 18px;
    padding: 10px 22px 10px 10px;
    box-shadow: 0 4px 14px rgba(44, 94, 151, 0.10);
    position: relative;
    overflow: hidden;
}
#badge-ultimo-dato-izq::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: #2c5e97;
    border-radius: 18px 0 0 18px;
}
#badge-ultimo-dato {
    display: flex;
    align-items: center;
    gap: 14px;
    background: white;
    border: 1.5px solid #e4edf7;
    border-radius: 18px;
    padding: 10px 22px 10px 10px;
    box-shadow: 0 4px 14px rgba(44, 94, 151, 0.10);
    position: relative;
    overflow: hidden;
}
#badge-ultimo-dato::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 6px;
    background: #2c5e97;
    border-radius: 18px 0 0 18px;
}
.badge-icono {
    background: #eef4fc;
    border-radius: 12px;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; color: #2c5e97;
    flex-shrink: 0; margin-left: 6px;
}
.badge-textos { display: flex; flex-direction: column; line-height: 1.2; }
.badge-label {
    font-size: 0.72rem; font-weight: 700;
    color: #8ba2b9; letter-spacing: 0.6px; text-transform: uppercase;
}
.badge-fecha { font-size: 1.2rem; font-weight: 800; color: #2c5e97; }
.badge-dot {
    width: 8px; height: 8px;
    background: #91be33; border-radius: 50%;
    position: absolute; top: 10px; right: 12px;
    animation: pulso-badge 2s infinite;
}
@keyframes pulso-badge {
    0%   { box-shadow: 0 0 0 0   rgba(145, 190, 51, 0.5); }
    70%  { box-shadow: 0 0 0 7px rgba(145, 190, 51, 0);   }
    100% { box-shadow: 0 0 0 0   rgba(145, 190, 51, 0);   }
}

/* ── HEADER ROW (tabs + badge) responsive ── */
.header-ranking-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.header-ranking-row .tabs-ranking {
    margin: 0 auto 0;
}
@media (max-width: 600px) {
    .tab-btn {
        padding: 8px 18px;
        font-size: .82rem;
    }
    .edicion-badge {
        font-size: .72rem;
        text-align: center;
        width: 100%;
    }
    .edicion-badge strong { font-size: .9rem; }
    .header-ranking-row {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    .header-ranking-row > div:first-child,
    .header-ranking-row > div:last-child {
        display: none !important;
    }
}

/* ── CARD CONTENEDOR ── */
.card-ranking {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--sombra);
    padding: 24px;
    animation: fadeUp .4s ease both;
}
@keyframes fadeUp {
    from { opacity:0; transform:translateY(14px); }
    to   { opacity:1; transform:translateY(0); }
}

/* ══════════════════════════════════════════
   VISTA LISTA
══════════════════════════════════════════ */

/* TOP 3 */
.top3-wrap {
    display: grid;
    grid-template-columns: 1fr 3px 1fr 3px 1fr;
    align-items: center;
    margin-bottom: 0;
    padding: 24px 0 28px;
    border-radius: 14px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    background: linear-gradient(135deg, #f8fbff 0%, #ffffff 100%);
}
.top3-divider {
    width: 3px;
    height: 160px;
    background: linear-gradient(to bottom, transparent, #e0e7ef 25%, #c5d3e0 50%, #e0e7ef 75%, transparent);
    align-self: center;
    border-radius: 2px;
}
.top3-card {
    text-align: center;
    cursor: pointer;
    transition: transform .2s, background .2s;
    padding: 20px 12px 16px;
    border-radius: 12px;
}
.top3-card:hover { transform: translateY(-5px); background: rgba(255,255,255,0.9); }
.top3-foto-wrap {
    position: relative;
    width: 150px; height: 150px;
    margin: 0 auto 14px;
}
.top3-foto {
    width: 150px; height: 150px;
    border-radius: 50%; object-fit: cover;
    border: 5px solid var(--verde);
    box-shadow: 0 4px 18px rgba(0,0,0,0.15);
}
.top3-logo-partido {
    position: absolute; bottom: 4px; right: -4px;
    width: 48px; height: 48px;
    border-radius: 50%; object-fit: cover;
    border: 3px solid #fff;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.top3-rkg {
    font-size: .75rem; font-weight: 900;
    color: #aaa; letter-spacing: 2px;
    text-transform: uppercase;
    display: flex; align-items: baseline; gap: 6px;
    justify-content: center;
    margin-bottom: 2px;
}
.top3-num {
    font-size: 2.6rem; font-weight: 900;
    line-height: 1;
}
.top3-nombre {
    font-size: 1.05rem; font-weight: 800;
    color: var(--texto); margin: 6px 0 2px;
}
.top3-entidad {
    font-size: .82rem; color: #888;
    font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; margin-bottom: 8px;
}
.top3-apro-label {
    font-size: .72rem; font-weight: 700; color: #bbb;
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 2px;
}
.top3-apro-val {
    font-size: 2.2rem; font-weight: 900;
    line-height: 1;
}

/* TÍTULO RANKING */
.titulo-ranking-gob {
    text-align: center;
    margin: 40px 0 28px;
    padding-top: 20px;
}
.titulo-ranking-gob span {
    display: block;
    font-size: 1.9rem; font-weight: 900;
    color: var(--azul); text-transform: uppercase;
    letter-spacing: 1.5px; line-height: 1.2;
}
.linea-verde-rkg {
    width: 60px; height: 4px;
    background: var(--verde);
    border-radius: 2px;
    margin: 10px auto 0;
}

/* FILTRO LISTA */
.filtro-lista {
    display: flex; gap: 8px; flex-wrap: wrap;
    margin-bottom: 16px; align-items: center;
}
.filtro-lista label {
    font-size: .8rem; font-weight: 700; color: #888;
}
.filtro-lista select {
    border: 2px solid #e2e8f0; border-radius: 25px;
    padding: 5px 16px; font-size: .82rem; font-weight: 700;
    color: var(--azul); background: #fff; cursor: pointer;
    outline: none;
}
.filtro-lista select:focus { border-color: var(--verde); }

/* FILA LISTA */
.lista-fila {
    display: flex; align-items: center;
    gap: 14px; padding: 10px 14px;
    border-radius: 14px; margin-bottom: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.lista-fila:hover {
    transform: translateX(4px);
    box-shadow: 0 3px 12px rgba(0,0,0,.1);
}
.lista-pos {
    font-size: 1.4rem; font-weight: 900;
    color: var(--verde); width: 36px; text-align: center;
    flex-shrink: 0;
}
.lista-foto-wrap {
    position: relative; flex-shrink: 0;
}
.lista-foto {
    width: 58px; height: 58px;
    border-radius: 50%; object-fit: cover;
    border: 3px solid var(--verde);
}
.lista-logo {
    position: absolute; bottom: -4px; right: -4px;
    width: 24px; height: 24px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid #fff; background: #fff;
}
.lista-info { flex: 1; min-width: 0; }
.lista-nombre {
    font-size: .92rem; font-weight: 800;
    color: var(--texto); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.lista-entidad {
    font-size: .78rem; color: #888; font-weight: 600;
}
.lista-barra-wrap {
    flex: 1; position: relative; max-width: 340px;
}
.lista-barra-bg {
    height: 18px; border-radius: 25px;
    background: #e2e8f0; overflow: hidden;
}
.lista-barra-fill {
    height: 100%; border-radius: 25px;
    transition: width .6s ease;
}
.lista-pct {
    font-size: 1rem; font-weight: 900;
    color: var(--texto); min-width: 60px; text-align: right;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════
   VISTA MOSAICO
══════════════════════════════════════════ */

/* Wrapper — fondo ligeramente grisáceo igual que el body */
.mosaico-wrapper {
    background: #f0f4f8;
}

/* Etiqueta de grupo: "Posiciones 1 – 8" */
.mosaic-grupo-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0 0 10px 2px;
}

/* Grid de 8 columnas por fila — una fila = 8 por grupo */
.mosaic-grupo {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

/* Segunda fila del mismo grupo */
.mosaic-grupo + .mosaic-grupo {
    margin-top: 10px;
}

/* Separador punteado entre grupos de 8 */
.mosaic-divisor {
    border: none;
    border-top: 2px dashed #e2e8f0;
    margin: 24px 0;
}

/* ── CARD tipo póster ── */
.mcard {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: transform .18s ease, box-shadow .18s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
.mcard:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,.14);
}

/* Zona foto — fondo gris redondeado
   aspect-ratio 1/1.15 = foto cuadrada ligeramente alta, cabe bien en 4 cols */
.mcard-foto-zone {
    background: #e8edf3;
    border-radius: 12px;
    margin: 8px 8px 0;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1.15;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

/* Foto del gobernador */
.mcard-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

/* Avatar con iniciales cuando no hay foto */
.mcard-iniciales {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
}

/* Badge posición — esquina superior izquierda de la foto */
.mcard-rkg-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .5px;
    background: rgba(0,0,0,.52);
    color: #ffffff;
    padding: 2px 7px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1.4;
}

/* Badge partido — esquina inferior derecha de la foto */
.mcard-partido-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,.20);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mcard-partido-badge img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Info debajo de la foto */
.mcard-body {
    padding: 8px 10px 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mcard-nombre {
    font-size: 11px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

.mcard-entidad {
    font-size: 9px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.mcard-pct {
    font-size: 18px;
    font-weight: 900;
    margin-top: 3px;
    line-height: 1;
    letter-spacing: .5px;
}

/* Pill semáforo dentro de la card */
.mcard-sem {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 20px;
    display: inline-block;
    margin: 3px auto 0;
}
.mcard-sem.sem-destacable  { background: #dcfce7; color: #15803d; }
.mcard-sem.sem-aceptable   { background: #fef9c3; color: #a16207; }
.mcard-sem.sem-noaceptable { background: #fee2e2; color: #b91c1c; }

/* ══════════════════════════════════════════
   VISTA MAPA
══════════════════════════════════════════ */
#mapa-mexico {
    width: 100%; max-width: 700px;
    margin: 0 auto; display: block;
}
#mapa-mexico path {
    fill: #e8eef5;
    stroke: #fff; stroke-width: 1.5;
    cursor: pointer;
    transition: fill .2s;
}
#mapa-mexico path:hover { fill: var(--verde); }
#mapa-mexico path.seleccionado { fill: var(--azul); }

.mapa-tooltip {
    position: absolute;
    background: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    pointer-events: none;
    font-size: .82rem;
    font-weight: 700;
    color: var(--texto);
    z-index: 999;
    white-space: nowrap;
    display: none;
}

.mapa-info-card {
    position: absolute;
    bottom: 16px; left: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    min-width: 220px;
    max-width: 280px;
    display: none;
    animation: fadeUp .3s ease both;
}

/* ══════════════════════════════════════════
   MODAL DETALLE
══════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 1050;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal-detalle {
    background: #fff;
    border-radius: 20px;
    width: 100%; max-width: 520px;
    box-shadow: 0 16px 60px rgba(0,0,0,.25);
    overflow: hidden;
    animation: slideUp .25s ease both;
}
@keyframes slideUp {
    from{opacity:0;transform:translateY(30px)}
    to{opacity:1;transform:translateY(0)}
}

.modal-header {
    padding: 20px 22px 16px;
    border-bottom: 2px solid var(--gris);
    display: flex; align-items: center; gap: 14px;
}
.modal-foto-wrap {
    position: relative; flex-shrink: 0;
}
.modal-foto {
    width: 80px; height: 80px;
    border-radius: 50%; object-fit: cover;
    border: 4px solid var(--verde);
}
.modal-logo {
    position: absolute; bottom: -4px; right: -4px;
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid #fff;
}
.modal-rkg-wrap {
    display: flex; align-items: center; gap: 8px;
}
.modal-rkg-label {
    font-size: .65rem; font-weight: 900;
    color: #aaa; letter-spacing: 1px;
}
.modal-rkg-num {
    font-size: 1.8rem; font-weight: 900;
    color: var(--azul); line-height: 1;
}
.modal-nombre {
    font-size: 1rem; font-weight: 900;
    color: var(--texto); text-transform: uppercase;
}
.modal-entidad {
    font-size: .82rem; font-weight: 700; color: #888;
}
.modal-region {
    font-size: .76rem; color: #aaa;
}

.modal-body { padding: 16px 22px; }

.modal-apro-row {
    display: flex; align-items: flex-end; gap: 16px;
    margin-bottom: 14px;
}
.modal-apro-label {
    font-size: .75rem; font-weight: 800;
    color: #aaa; text-transform: uppercase; letter-spacing: .5px;
}
.modal-apro-val {
    font-size: 2rem; font-weight: 900; color: var(--azul); line-height: 1;
}

/* ── Semáforo ── */
.semaforo-pill {
    display: inline-flex; align-items: center; gap: 6px;
    border-radius: 25px; padding: 4px 12px;
    font-size: .78rem; font-weight: 800;
    color: #fff;
}
.sem-destacable  { background: #22c55e; }
.sem-aceptable   { background: #f59e0b; }
.sem-noaceptable { background: #ef4444; }

/* Coalición logos */
.coalicion-logos {
    display: flex; gap: 8px; flex-wrap: wrap;
    align-items: center; margin-top: 6px;
}
.coalicion-logos img {
    width: 28px; height: 28px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid #eee;
}

/* Gráfica histórico en modal */
.modal-hist-wrap {
    height: 140px; position: relative;
    margin-top: 12px;
}

.modal-footer-btns {
    padding: 12px 22px 18px;
    display: flex; justify-content: center;
}
.btn-cerrar-modal {
    background: var(--verde); color: #fff;
    border: none; border-radius: 25px;
    padding: 10px 40px; font-weight: 800;
    font-size: .9rem; cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 3px 12px rgba(145,190,51,.4);
}
.btn-cerrar-modal:hover { transform: translateY(-2px); }

/* ── TAG LINK GLOBAL ── */
#rkg-tag-bar-global {
    text-align: center;
    padding: 22px 0 12px;
    border-top: 2px solid #d1d5db;
    margin-top: 10px;
}
#rkg-tag-bar-global .rkg-tag-link {
    display: inline-block;
    color: #2c5e97;
    font-size: 1.1rem;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    margin: 0 8px;
    letter-spacing: .3px;
    transition: color .15s;
}
#rkg-tag-bar-global .rkg-tag-link:hover {
    color: #1e3a5f;
}
/* ── LOADING / ERROR ── */
.loading {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    min-height: 50vh; gap: 14px; color: #888;
}
.spinner-cripeso {
    width: 44px; height: 44px;
    border: 4px solid #ddd; border-top-color: var(--azul);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to{ transform:rotate(360deg); } }
.error-msg {
    text-align: center; padding: 60px 20px;
    color: #ef4444; font-weight: 700; font-size: 1.1rem;
}

/* ── MAPA PIN ── */
.mapa-pin {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
    animation: bounce .6s ease infinite alternate;
}
@keyframes bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-6px); }
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
    .mosaic-grupo { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 768px) {
    .lista-barra-wrap { display: none; }
    .top3-wrap { grid-template-columns: 1fr; gap: 0; }
    .top3-divider {
        width: 80%; height: 3px; margin: 0 auto;
        background: linear-gradient(to right, transparent, #c5d3e0 25%, #c5d3e0 75%, transparent);
    }
    .top3-foto-wrap { width: 110px; height: 110px; }
    .top3-foto { width: 110px; height: 110px; }
    .top3-logo-partido { width: 38px; height: 38px; }
    .top3-num { font-size: 2rem; }
    .top3-apro-val { font-size: 1.7rem; }
    .mosaic-grupo { grid-template-columns: repeat(2, 1fr); }
    /* lista-fila más compacta en móvil */
    .lista-fila { gap: 10px; padding: 9px 10px; }
    .lista-pos { font-size: 1.1rem; width: 28px; }
    .lista-foto { width: 48px; height: 48px; }
    .lista-logo { width: 20px; height: 20px; }
    .lista-nombre { font-size: .85rem; }
    .lista-entidad { font-size: .72rem; }
    .lista-pct { font-size: .9rem; min-width: 50px; }
}
@media (max-width: 420px) {
    .mosaic-grupo { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .mcard-nombre { font-size: 11px; }
    .mcard-pct    { font-size: 17px; }
}

   LEYENDA MAPA — Agregar al final de rank_estilo.css
══════════════════════════════════════════ */

.leyenda-mapa-cripeso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(90deg, #1e3a5f 0%, #2c5e97 50%, #1e3a5f 100%);
    border-radius: 14px;
    padding: 14px 24px;
    margin-bottom: 18px;
    box-shadow: 0 2px 16px rgba(44, 94, 151, 0.18);
    position: relative;
    overflow: hidden;
}

.leyenda-mapa-cripeso::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        100deg,
        transparent,
        transparent 60px,
        rgba(255, 255, 255, 0.04) 60px,
        rgba(255, 255, 255, 0.04) 62px
    );
    pointer-events: none;
}

.leyenda-icono {
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: pulse-map 2s ease-in-out infinite;
}

@keyframes pulse-map {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%       { transform: scale(1.18); opacity: 0.85; }
}

.leyenda-texto-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.leyenda-titulo {
    font-size: .82rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.1;
}

.leyenda-subtitulo {
    font-size: .72rem;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    letter-spacing: .3px;
}

.leyenda-divisor {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.leyenda-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.leyenda-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 4px 12px 4px 8px;
    font-size: .7rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .4px;
    white-space: nowrap;
}

.pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 4px 1px rgba(0, 0, 0, .2);
}

.leyenda-flecha-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.leyenda-cta {
    font-size: .76rem;
    font-weight: 900;
    color: #FFD54F;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.leyenda-flecha {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    animation: bounce-r 1.2s ease-in-out infinite;
}

@keyframes bounce-r {
    0%, 100% { transform: translateX(0); }
    50%       { transform: translateX(5px); }
}

@media (max-width: 768px) {
    .leyenda-mapa-cripeso {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 14px 16px;
    }
    .leyenda-divisor { width: 60%; height: 1px; }
    .leyenda-texto-wrap { align-items: center; }
    .leyenda-pills { justify-content: center; }
}

@media (max-width: 480px) {
    .leyenda-mapa-cripeso {
        padding: 12px 10px;
        gap: 8px;
        border-radius: 10px;
    }
    .leyenda-pills {
        gap: 5px;
    }
    .leyenda-pill {
        font-size: .65rem;
        padding: 3px 9px 3px 6px;
    }
    .leyenda-titulo { font-size: .75rem; letter-spacing: 1px; }
    .leyenda-subtitulo { font-size: .67rem; }
    .leyenda-cta { font-size: .68rem; }
    .leyenda-icono { font-size: 1.2rem; }
    /* ocultar divisores en pantallas muy chicas */
    .leyenda-divisor { display: none; }
}
/* ══════════════════════════════════════════════════════════
   SVG MAPA PROPIO (mx.svg) — Estilos adicionales
   Cripeso · Motor SVG sin dependencia de SimpleMaps
══════════════════════════════════════════════════════════ */

/* Contenedor responsive del SVG */
#mx-svg-container {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
    line-height: 0; /* Evita espacio extra debajo del SVG */
}

#mx-svg-container svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
}

/* Estados del mapa SVG */
#mx-svg-container path[id^="MX"],
#mx-svg-container circle[id^="MX"] {
    transition: fill .2s ease, filter .15s ease;
    cursor: pointer;
    stroke: #ffffff;
    stroke-width: 0.5;
}

#mx-svg-container path[id^="MX"]:hover,
#mx-svg-container circle[id^="MX"]:hover {
    filter: brightness(0.85);
}

/* Círculos de estados pequeños — más visibles */
#mx-svg-container circle[id^="MX"] {
    r: 6px; /* Asegurar tamaño mínimo */
    stroke-width: 1.2;
}

/* Tooltip flotante del SVG */
#svg-mx-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    background: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    font-family: 'Segoe UI', sans-serif;
    min-width: 160px;
    text-align: center;
    opacity: 0;
    transition: opacity .15s;
}

/* Sigla activa en la barra */
.sigla-btn.sigla-activa {
    outline: 2px solid rgba(255,255,255,.6);
    outline-offset: 1px;
    transform: scale(1.08);
}

/* ── RESPONSIVE MAPA ── */
@media (max-width: 768px) {
    #mx-svg-container {
        max-width: 100%;
    }
    /* En móvil la tarjeta lateral va arriba */
    #mapa-side-card {
        width: 100% !important;
        min-height: auto !important;
    }
}